{include file="common/header" /}
<!-- 中间区域 -->
<div class="cssq">
	<div class="cssq_l"><img src="/public/home/images/asadas_06.jpg"></div>

	<div class="cssq_c">
		<h1>{$goods.title}</h1>

		<p>挂牌价：<span>{$goods.goods_price}</span>起 预存价：
<!--			{foreach name="goods_attr" item="attr"}-->
<!--				<li>-->
<!--					<div class="pro_de-sti">{$attr.attr_value_name|default=''}：</div>-->
<!--					{if isset($attr.attr_value_type) && $attr.attr_value_type == 1}-->
<!--					<div class="pro_de-stc">-->
<!--						{foreach name="attr.attr_list" item="vo"}-->
<!--						<span data-value-name="{$attr.attr_value_name|default=''}" data-vid="{$attr.id}" data-value="{$vo.attr_value}" data-goods-aid="{$vo.id}" class="span_active" style="border: none;color: #999">{$vo.attr_value}</span>-->
<!--						{/foreach}-->
<!--					</div>-->
<!--					{else}-->
<!--					<div class="pro_de-stc">-->
<!--						{foreach name="attr.attr_list" item="vo"}-->
<!--						<span data-value-name="{$attr.attr_value_name|default=''}" data-vid="{$attr.id}" data-value="{$vo.attr_value}" data-goods-aid="{$vo.id}">{$vo.attr_value}</span>-->
<!--						{/foreach}-->
<!--					</div>-->
<!--					{/if}-->
<!--				</li>-->
<!--			{/foreach}-->
			{foreach name="goods_attr" item="attr"}
				{if isset($attr.attr_value_type) && $attr.attr_value_type == 1}
					{foreach name="attr.attr_list" item="vo"}
						<span>{$vo.attr_value}</span>
					{/foreach}
				{/if}
			{/foreach}
			折</p>

		<div class="zuuo">
			<a href="javascript:;" id="toPay" data-id="{$goods.id}" data-price="{$goods.goods_price}">立即预约</a><a href="tel:{$function->getAdPosition('1')['desc_text']}">咨询电话</a>
		</div>
	</div>

	<div class="cssq_r">预约次数：{$goods.number_sales}次</div>
</div>

<div class="gnjs">
	<img src="/public/home/images/asadas_14.jpg">
	<p>功能介绍</p>
</div>

<div class="jsou">
	{$goods.content|raw}
</div>

<div class="gnjs">
	<img src="/public/home/images/asadas_14.jpg">
	<p>常见问题</p>
</div>

<div class="kuot">
	<ul>
		{foreach name="function->getCatArticle('16','99')" item="cat"}
		<li>
			<h1>{$cat.title} </h1>
			<p>
				{$cat.content|raw}
			</p>
		</li>
		{/foreach}
	</ul>
</div>

<div class="gnjs">
	<img src="/public/home/images/asadas_14.jpg">
	<p>推荐测试案例</p>

	<div class="gnjs_r">
		<a href="/store-list">
			<img src="/public/home/images/asdoiasodk_59.jpg">
			<h1>查看更多</h1>
		</a>
	</div>
</div>

<div class="cs cspo">
	<ul>
		{foreach name="hot_goods" item="hot"}
		<li>
			<img src="{$hot.logo}">
			<div class="cs_c">
				<h2>{$hot.title}</h2>
				<a href="/store-info-{$hot.id}">去预约</a>
			</div>
		</li>
		{/foreach}
</div>

<div class="checkout-box">
	<div class="box-close">X</div>
	<div class="box-content">
		<form action="/index/flow/toPay" id="toPayForm" data-auto="true" method="post" autocomplete="off">
			<ul>
				<li>
					<p>姓名</p>
					<input type="text" name="name" class="a1">
				</li>
				<li>
					<p>电话</p>
					<input type="text" name="phone" class="a1">
				</li>
				<li>
					<p>备注说明</p>
					<textarea type="text" name="order_desc" class="a2"></textarea>
				</li>
				<li>
					<p>支付方式</p>
					<input type="radio" name="pay_id" value="2" checked> 支付宝&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="radio" name="pay_id" value="1"> 微信
				</li>
				<input type="hidden" name="goods_id">
				<input type="hidden" name="goods_price">
				<input type="hidden" name="amount">
				<span id="toPaySubmit" class="submit">预约支付</span>
			</ul>
		</form>
	</div>
</div>
<script>
	$(".checkout-box").hide();
	$("#toPay").click(function (){
		var goods_id = $(this).attr("data-id");
		var goods_price = $(this).attr("data-price");
		var amount = goods_price;

		$("input[name='goods_id']").val(goods_id);
		$("input[name='goods_price']").val(goods_price);
		$("input[name='amount']").val(amount);
		$(".checkout-box").show();
	});
	$(".box-close").click(function (){
		$(".checkout-box").hide();
	});

	$("#toPaySubmit").click(function(){
		var targetUrl = "/index/flow/toPay";
		var is_login = 1;
		var name = $("input[name='name']").val();
		var phone = $("input[name='phone']").val();
		if(!name){
			alert("请输入姓名");
			return false;
		}
		if(!phone){
			alert("请输入电话");
			return false;
		}


		$.ajax({
			type:'post',
			url:targetUrl,
			cache: false,
			data:{is_login:is_login,},  //重点必须为一个变量如：data
			dataType:'json',
			success:function(data){
				if (data.code== 0) {
					alert(data.info);
					return false;
				}else{
					$("#toPayForm").submit();
				}

			}
		})

	})
</script>
{include file="common/footer" /}